package com.crm.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@Entity
@Table(name="news")
@ApiModel("新闻资讯")
public class News implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@GenericGenerator(name = "system-uuid", strategy = "uuid2")
	@GeneratedValue(generator = "system-uuid")
	@ApiModelProperty(value="新闻id",required=true,hidden = true)
	private String id;
	
	@ApiModelProperty(value="新闻标题",required=true)
	private String title;
	
	@ApiModelProperty(value="新闻点击数")
	private Integer click;
	
	
	@ApiModelProperty(value="新闻添加时间",hidden = true)
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSXXX")
	@DateTimeFormat
	private Date addTime;
	
	@ApiModelProperty(value="新闻内容",required=true)
	private String content;
	
	@ApiModelProperty(value="新闻左侧图片",required=true)
	private String img;
	
	@ApiModelProperty(value="新闻摘要",required=true)
	private String tabloid;
	
	@ApiModelProperty(value="新闻分类",required=true)
	private String category;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Integer getClick() {
		return click;
	}
	public void setClick(Integer click) {
		this.click = click;
	}
	public Date getAddTime() {
		return addTime;
	}
	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getTabloid() {
		return tabloid;
	}
	public void setTabloid(String tabloid) {
		this.tabloid = tabloid;
	}
	public String getImg() {
		return img;
	}
	public void setImg(String img) {
		this.img = img;
	}
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	@Override
	public String toString() {
		return "News [id=" + id + ", title=" + title + ", click=" + click + ", addTime=" + addTime + ", content="
				+ content + ", img=" + img + ", category=" + category + "]";
	}

	
	
}
